<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <script>
    var oldClass = ['小明', '小强'];
    oldClass[2] = '小亮';
    oldClass[3] = '小东';
    console.log(oldClass);  // 输出结果：(4) ["小明", "小强", "小亮", "小东"]

    var newClass = [];
    newClass[0] = 'Ani';
    newClass[4] = 'Calen';
    newClass[3] = 'Mastin';
    console.log(newClass);  // 输出结果：(5) ["Ani", empty × 2, "Mastin", "Calen"]
  </script>  
</body>
</html>